// 注入子系统路由信息
const injectRouter = (it) => it.then((data) => {
  const router = data?.default;
  if (Array.isArray(router)) {
    return router;
  }
  return [];
}).catch(() => []);

const allRouter = [
  {
    path: '/',
    component: () => import('./home'),
  },
];
// React Body 路由
const rb = injectRouter(import('@monet/body/pages/routes'));
// 页面路由配置
export const loadRoutes = async () => await Promise.all([rb, allRouter]).then((data) => data.reduce((acc, cur) => acc.concat(...cur), []));
